﻿//
// Created by Arosy on 2021/11/25.
//

//
// Created by Arosy on 2021/11/25.
//
//#include "InstanceKlass.h"
//#include "CodeAttributeInfo.h"
// extern class CodeAttributeInfo;
// extern class InstanceKlass ;
public class MethodInfo
{
	private InstanceKlass belongKlass;
	private short accessFlags;
	private int nameIndex;
	private int descriptorIndex;
	private int attributesCount;
	private CodeAttributeInfo[] attributeInfo;
	private string methodName;
	public void setAttributeInfo(CodeAttributeInfo attributeInfo, int index)
	{
		this.attributeInfo[index] = attributeInfo;
	}

	public void initCodeAttributeInfo()
	{
		attributeInfo = Arrays.InitializeWithDefaultInstances<CodeAttributeInfo>(attributesCount);
	}

//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 WARNING: 'const' methods are not available in C#:
//ORIGINAL LINE: InstanceKlass *getBelongKlass() const
	public InstanceKlass getBelongKlass()
	{
		return belongKlass;
	}

	public void setBelongKlass(InstanceKlass belongKlass)
	{
//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 TODO TASK: C# does not have an equivalent to pointers to variables (in C#, the variable no longer points to the original when the original variable is re-assigned):
//ORIGINAL LINE: MethodInfo::belongKlass = belongKlass;
		this.belongKlass = belongKlass;
	}

//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 WARNING: 'const' methods are not available in C#:
//ORIGINAL LINE: short getAccessFlags() const
	public short getAccessFlags()
	{
		return accessFlags;
	}

	public void setAccessFlags(short accessFlags)
	{
		this.accessFlags = accessFlags;
	}

//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 WARNING: 'const' methods are not available in C#:
//ORIGINAL LINE: int getNameIndex() const
	public int getNameIndex()
	{
		return nameIndex;
	}

	public void setNameIndex(int nameIndex)
	{
		this.nameIndex = nameIndex;
	}

//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 WARNING: 'const' methods are not available in C#:
//ORIGINAL LINE: int getDescriptorIndex() const
	public int getDescriptorIndex()
	{
		return descriptorIndex;
	}

	public void setDescriptorIndex(int descriptorIndex)
	{
		this.descriptorIndex = descriptorIndex;
	}

//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 WARNING: 'const' methods are not available in C#:
//ORIGINAL LINE: int getAttributesCount() const
	public int getAttributesCount()
	{
		return attributesCount;
	}

	public void setAttributesCount(int attributesCount)
	{
		this.attributesCount = attributesCount;
	}

//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 WARNING: 'const' methods are not available in C#:
//ORIGINAL LINE: CodeAttributeInfo *getAttributeInfo() const
	public CodeAttributeInfo[] getAttributeInfo()
	{
		return attributeInfo;
	}

	public void setAttributeInfo(CodeAttributeInfo[] attributeInfo)
	{
        if(this.attributeInfo==null)
		this.attributeInfo = attributeInfo;
	}

//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 WARNING: 'const' methods are not available in C#:
//ORIGINAL LINE: const string &getMethodName() const
	public string getMethodName()
	{
		return methodName;
	}

	public void setMethodName(string methodName)
	{
		this.methodName = methodName;
	}
}
